<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>背景图片</title>
	<style>
	    div{
		    margin-top:20px;
		}
	    .box1{
		    width:500px;
			height:300px;
			background-image:url(images/1.jpg);
			font-size:20px;
			color:yellow;
		}
		.box2{
		    width:200px;
			height:100px;
			background-image:url(images/1.jpg);
			font-size:20px;
			color:red;
		}
	</style>
</head>
<body>
    <div class="box1">书中自有颜如玉</div>
	<div class="box2">书中自有黄金屋</div>
</body>
</html>